<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css</title>
</head>
<style>
    body {
        text-align: center;
        position: relative;
    }
    [class^=content] {
        color: white;
        padding: 30px 15px;
    }
    .content {
        width: 500px;
        text-align: left;
        margin: 0 auto;
        background-color: purple;
        color: white;
        padding: 30px 15px;
    }
    .content1 {
        width: 500px;
        position: relative;
        float: left;
        left: 50%;
        margin-left: -250px;
        background-color: purple;
        color: white;
        padding: 30px 15px;
    }
    .content2 {
        width: 800px;
        position: absolute;
        left: 50%;
        margin-left: -400px;
        background-color: purple;
    }
    .content3 {
        width: 800px;
        position: absolute;
        margin: 0 auto;
        left: 0;
        right: 0;
        background-color: purple;
    }
    .Center-Container {
        background-color: gray;
        position: relative;
        width: 400px;
        height: 400px;
    }
    .Absolute-Center {
        background-color: hotpink;
        width: 50%;
        height: 50%;
        overflow: auto;
        margin: auto;
        position: absolute;
        top: 0; left: 0; bottom: 0; right: 0;
    }
    .Is-Fixed {
        position: fixed;
        z-index: 999;
    }
    .outerbox {
        float: left;
        position: relative;
        left: 50%;
    }
    .innerbox {
        float: right;
        position: relative;
        right: 50%;
    }
</style>
<body>
    body
    <!-- <section>
        <h3>inline 元素</h3>
        <div style="text-align: center;">
            <p style="display: inline;">inline p</p>
        </div>
    </section>
    <div class="content">
        content
    </div>
    <div class="content1">
        aaaaaa aaaaaa a a a a a a a a
    </div>
    <div class="content2">
        aaaaaa aaaaaa a a a a a a a a
    </div>
    <div class="content3">
        aaaaaa aaaaaa a a a a a a a a
    </div> -->
    <!-- <div class="Center-Container">
        Center-Container
        <div class="Absolute-Center Is-Fixed">
            Absolute-Center
        </div>
    </div> -->
    <div class="outerbox">
        <div class="innerbox">
            我是浮动的
        </div>
    </div>
</body>
<script>
    var scope = "global scope";
    function checkscope(){
        var scope = "local scope";
        function f(){
            return scope;
        }
        return f;
    }

    var foo = checkscope(); 
    foo();
</script>
</html>